package server;

import java.io.*;
import java.net.ServerSocket;
import java.sql.SQLException;

/**
 * Created with IntelliJ IDEA.
 * User: Igor Demidov
 * Date: 16.02.13
 * Time: 20:47
 */
public class MainServer {
    public static void main(String[] args) throws IOException, SQLException {
        final int port = 8080;
        ServerSocket serverSocket = null;
        boolean listening = true;
        DataAccessObject dataAccessObject = new DataAccessObject();
        try {
            serverSocket = new ServerSocket(port);
        } catch (IOException e) {
            System.err.println("Could not listen on port");
            System.exit(-1);
        }

        while (listening) {
            new MultiServerThread(serverSocket.accept()).start();
        }
        serverSocket.close();
    }
}
